//1.导入vue 和 vuerouter 的包
import Vue from 'vue'
import VueRouter from 'vue-router'
import list from '../views/list'
import songList from "@/views/songList";
import search from "@/views/search"
import home from "@/views/home";
import topList from "@/views/topList";
import mv from "@/views/mv";
import singer from "@/views/singer";
import artist from "@/views/artist";
import lyric from "@/components/text/lyric";
//2.调用vue.use() 函数，把 VueRouter 安装为 Vue 的插件
//vue.use()函数的作用，就是来安装插件的
Vue.use(VueRouter)

//3.创建路由的实例对象
const router = new VueRouter({
    routes:[
        {path:'/',redirect:'/home'},
        //首页
        {path:'/home',component:home},
        //推荐歌单
        {path:'/list',component:list},
        //排行榜
        {path:'/toplist',component:topList},
        //mv
        {path:'/mv',component:mv},
        //歌手
        {path:'/singer',component:singer},
        //歌单详情
        {path:'/songList',component:songList},
        //关键字搜索结果
        {path:'/search',component:search},
        //歌手详情
        {path:'/artist',component:artist},
        {path:'/lyric',component:lyric}
    ],
    mode:"history"
})

//4.向外共享路由的实例对象
export default router
